import axios from 'axios';

// 获取磁盘监控数据（支持分页）
export const getDiskInfo = (page = 0, size = 10) => {
  console.log('getDiskInfo called with page:', page, 'size:', size);
  return axios.get('http://localhost:8080/api/disk-info', {
    withCredentials: true,
    params: {
      page,
      size
    }
  }).catch(error => {
    console.error('Axios request error:', error.message);
    if (error.response) {
      console.error('Response status:', error.response.status);
      console.error('Response data:', error.response.data);
    } else if (error.request) {
      console.error('No response received:', error.request);
    } else {
      console.error('Request setup error:', error.message);
    }
    throw error;
  });
};